#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTextCodec>
#include <QFileDialog>
#include <QMessageBox>
#include <QPixmap>
#include <QImage>
#include <QSqlDatabase>
#include <QDebug>
#include <QBuffer>
#include <QSqlQuery>
//#include <QVariant>
#include <QSqlError>
#include <QSqlDriver>
#include <QtSql>
#include <QTextDocumentWriter>
#include "OOReader.h"
#include "wizard.h"
#include "testdialog.h"

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void ShowQuestion(int QuestionID);
    bool FreshtestID();
private slots:
    void on_actionLoadQuestion_triggered();
    void on_actionUpdateItem_triggered();
    void on_actionLoadOptions_triggered();
    //void on_valueChanged(int);
    void on_actionAddItem_triggered();
    void on_actionDeleteItem_triggered();
    void on_horizontalScrollBar_valueChanged(int);
    void on_horizontalScrollBar_sliderPressed();
    void on_horizontalScrollBar_sliderReleased();
    void on_actionQuestionImportImage_triggered();
    void on_actionOptionsImportImage_triggered();
    void drawDoc();
    void drawOptions();
    void on_combo_teststyle_currentIndexChanged ( int index ) ;
    void on_combo_subject_currentIndexChanged ( int index ) ;
    void on_actionPaperScope_triggered();
    void on_actionTest_triggered();
    void ShowAnswer(int iAnswer);
    void on_radioButtonA_clicked(bool checked);
    void on_radioButtonB_clicked(bool checked);
    void on_radioButtonC_clicked(bool checked);
    void on_radioButtonD_clicked(bool checked);
    void on_radioButtonE_clicked(bool checked);
    void UpdateItemAnswer(int iAnswer);
private:
    Ui::MainWindow *ui;
    QSqlQuery *m_query;
    int m_iRecordAmount;
    int m_iRecordCurrentID;
    int m_subjectID;
    int m_teststyleID;
    int m_bScrollBarStoped;
    OOReader *Ooo,*OOoptions;
    PushDoc *forceQuestion;
    PushDoc *forceOptions;
    QSqlQueryModel *teststyle_model;
    QSqlQueryModel *subject_model;
    Wizard *w;
    testDialog *test;

};

#endif // MAINWINDOW_H
